package com.chuangke.mds.controller;

import com.chuangke.common.http.HttpResult;
import com.chuangke.mds.service.TechnologyProcessParamsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("zchkcl/technologyProcessParams")
public class TechnologyProcessParamsController {
    @Autowired
    private TechnologyProcessParamsService technologyProcessParamsService;

    @PreAuthorize("hasAuthority('login:action')")
    @GetMapping("/getProcessParams")
    public HttpResult getProcessParams(@RequestParam String type) {
        return HttpResult.ok(technologyProcessParamsService.getProcessParams(type));
    }
    @PreAuthorize("hasAuthority('login:action')")
    @GetMapping("/getSimulationParams")
    public HttpResult getSimulationParams(@RequestParam String processProcedureId){
        return HttpResult.ok(technologyProcessParamsService.getSimulationParams(processProcedureId));
    }

    @PreAuthorize("hasAuthority('login:action')")
    @GetMapping("/getSimulationParamsType")
    public HttpResult getSimulationParams(@RequestParam Map<String,Object> params){
        return HttpResult.ok(technologyProcessParamsService.getSimulationParams(params));
    }

}
